<%@page import="java.util.Map"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="sec" uri="/WEB-INF/tags/shiro.tld"%>
<%@ page import="avicit.platform6.commons.utils.ComUtil"%>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>编辑</title>

<base href="<%=ComUtil.getRequestPath(request) %>">
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<% 
Object lang=session.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
String languageCode="zh_CN";
if(lang!=null){
	languageCode=lang.toString();
}
	Locale locale =SessionHelper.getLocaleByUser(request);
%>
<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript"
	src="avicit/cbb/businessclass/fondsmanage/locale/language_<%=languageCode%>.js"></script>
<link href="avicit/cape/oms/css/icon.css" type="text/css"
	rel="stylesheet">
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
</head>
<style>
	.remind{
		color:red;
	}
	.thead{
		text-align:right;
	}
</style>
<body class="easyui-layout" fit="true">
	<% Map<String, Object> map = (Map<String, Object>)request.getAttribute("cbbFondsDbV"); %>
	<div region="center" border="false" style="overflow: hidden;">
		<form id="formCbbFondsDb" method="post">
			<table class="table_init" style="width:80%;margin-left: 56px;">
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_odCode">
						<%-- 全宗号 --%>
						<td width="20%" class="thead"><span class=""></span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.allArchiveNum","i18n.lantop",locale)%></td>
						<td width="30%"><input type="text" validType="length[0,100]"
							style="" class="easyui-validatebox"
							data-options="required:true" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.allArchiveNum","i18n.lantop",locale)%>" id="odCode"
							value="<%= null == map.get("ORG_CODE") ? "" : map.get("ORG_CODE") %>"
							readonly="readonly" /></td>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_odName">
						<%-- 全宗名称 --%>
						<td width="20%" class="thead"><span class=""></span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.allArchiveName","i18n.lantop",locale)%></td>
						<td><input type="text" validType="length[0,100]"
							style="" class="easyui-validatebox"
							data-options="required:true" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.allArchiveName","i18n.lantop",locale)%>" id="odCode"
							value="<%= null == map.get("ORG_NAME") ? "" : map.get("ORG_NAME") %>"
							readonly="readonly" /></td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_dbName">
						<%-- 数据库名称 --%>
						<td width="20%" class="thead"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databaseName","i18n.lantop",locale)%></td>
						<td width="30%"><input type="text" validType="length[0,50]"
							style="" class="easyui-validatebox"
							data-options="required:true" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databaseName","i18n.lantop",locale)%>" id="dbName"
							name="dbName"
							value="<%= null == map.get("DB_NAME") ? "" : map.get("DB_NAME")  %>" />
						</td>
					</sec:accesscontrollist>

					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_dbPort">
						<%-- 端口 --%>
						<td width="20%" class="thead"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.port","i18n.lantop",locale)%></td>
						<td><input type="text" validType="length[0,50]"
							style="" class="easyui-numberbox" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.port","i18n.lantop",locale)%>"
							id="dbPort" name="dbPort" data-options="required:true"
							value="<%= null == map.get("DB_PORT") ? "" : map.get("DB_PORT") %>" />
						</td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_dbIp">
						<%-- 数据库服务器IP --%>
						<td width="20%" class="thead"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databaseServerIP","i18n.lantop",locale)%></td>
						<td width="30%"><input type="text"
							data-options="required:true,validType:'length[0,200]'"
							style="" class="easyui-validatebox" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databaseServerIP","i18n.lantop",locale)%>"
							id="dbIp" name="dbIp"
							value="<%= null == map.get("DB_IP") ? "" : map.get("DB_IP") %>" />
						</td>
					</sec:accesscontrollist>

					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_dbUser">
						<%-- 数据库用户名 --%>
						<td width="20%" class="thead"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databaseUserName","i18n.lantop",locale)%></td>
						<td><input type="text" validType="length[0,50]"
							style="" class="easyui-validatebox" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databaseUserName","i18n.lantop",locale)%>"
							id="dbUser" name="dbUser" data-options="required:true"
							value="<%= null == map.get("DB_USER") ? "" : map.get("DB_USER") %>" />
						</td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_dbPassword">
						<%-- 数据库密码 --%>
						<td width="20%" class="thead"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databasePassword","i18n.lantop",locale)%></td>
						<td width="30%"><input type="password" validType="length[0,50]"
							style="" class="easyui-validatebox" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.databasePassword","i18n.lantop",locale)%>"
							id="dbPassword" name="dbPassword" data-options="required:true"
							value="<%= null == map.get("DB_PASSWORD") ? "" : map.get("DB_PASSWORD") %>" />
						</td>
					</sec:accesscontrollist>
					<th width="20%"></th>
					<td></td>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbEdit_formCbbFondsDb_remark">
						<%-- 备注 --%>
						<td width="20%" class="thead"><span class=""></span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.comment","i18n.lantop",locale)%></td>
						<td colspan="3"><textarea class="textareabox" title='<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.comment","i18n.lantop",locale)%>' name="remark"
								id="remark" validType="length[0,4000]"><%= null == map.get("REMARK") ? "" : map.get("REMARK") %></textarea>
						</td>
					</sec:accesscontrollist>
				</tr>
			</table>
			<div style="display: none;">
				<label>id</label>
				<div class="inputContainer">
					<input name="id" id="id" required="true"
						value="<%=map.get("ID") %>" style="" />
				</div>
			</div>

			<div style="display: none;">
				<label>version</label>
				<div class="inputContainer">
					<input name="version" id="version" required="true"
						value="<%=map.get("VERSION") %>" style="" />
				</div>
			</div>
		</form>
	</div>
	
	<div data-options="region:'south',border:false" style="height:40px;">
		<div id="toolbar">
		<table class="tableForm" border="0" cellspacing="1" width="100%">
				<tr>
					<td align="center">
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_CbbFondsDbEdit_button_saveButton">
							<%-- 保存 --%>
							<a id="saveButton" class="easyui-linkbutton selbtnc" iconCls="icon-im-save" onclick="saveForm();"
								href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.button.save","i18n.lantop",locale)%></a>
						</sec:accesscontrollist>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_CbbFondsDbEdit_button_resetForm">
							<%-- 重置 --%>
							<a id="resetButton" class="easyui-linkbutton selbtnc" iconCls="icon-im-newreduction"
								onclick="resetForm();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.button.reset","i18n.lantop",locale)%></a>
						</sec:accesscontrollist>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_CbbFondsDbEdit_button_backForm">
							<%-- 返回 --%>
							<a id="backButton" class="easyui-linkbutton selbtnc" iconCls="icon-im-back"
								onclick="closeWindow();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.edit.button.return","i18n.lantop",locale)%></a>
						</sec:accesscontrollist>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<script type="text/javascript">
		var dialogId = "${dialogId}";
		var sysId = "${param.sysId}";
		
		/**
		 * IP地址格式验证
		 */
		$.extend($.fn.validatebox.defaults.rules, {
			validateIp : {
				validator : function(value, param) {
					var pattern = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
					return pattern.test(value);
				},
				message : 'IP地址格式不正确'
			}
		});

		//保存
		function saveForm() {
			/***必填字段空格验证 - 2015/11/17 增加 （郭亮）***/
			var dbName = $("#dbName").val().replace(/(^\s+)|(\s+$)/g, "");
			var dbUser = $("#dbUser").val().replace(/(^\s+)|(\s+$)/g, "");
			$("#dbName").val(dbName);
			$("#dbUser").val(dbUser);
			/***必填字段空格验证 - 2015/11/17 增加 （郭亮）***/
			var validateFlag = $('#formCbbFondsDb').form('validate');
			if (validateFlag == false) {
				return;
			}
			var dataVo = $('#formCbbFondsDb').serializeArray();
			var dataJson = convertToJson(dataVo);
			dataVo = JSON.stringify(dataJson);
			$.ajax({
				url : 'platform/cbbFondsDbController/saveCbbFondsDb',
				data : {
					datas : dataVo,
					sysId : sysId,
					type : 'eidt'
				},
				type : 'post',
				dataType : 'json',
				success : function(result) {
					parent.freDataGrid();
					closeWindow();
				}
			});
		}

		/**
		 * 关闭弹出窗口
		 */
		function closeWindow() {
			if (parent != null && parent.$('#' + dialogId) != null) {
				parent.$('#' + dialogId).dialog('close');
			}
		}

		/**
		 * 重置表单数据
		 */
		function resetForm(formName, type) {
			$('#formCbbFondsDb').form('reset');
		}
	</script>
</body>
</html>